﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SiteAgle.Models
{
    public partial class Sprint
    {

        public int Finalizado()
        {
            int totalTarefas = this.Tarefas.Count();
            int totalFinalizadas = this.Tarefas.Where(t => t.StatusTarefas.Id == 4).Count();
            int percentual = 0;
            if (totalTarefas != 0)
            {
                percentual = (totalFinalizadas * 100) / totalTarefas;
            }
            return percentual;
        }
    }
}